<template>
	<view>
		<view class="fs50 color fw900 pl40" style="padding-top: 140rpx;">欢迎登录</view>
		<view class="pl40 dflex alc mt10">
			<view class="gray">还没有账号,</view>
			<view class="colora" @click="handerReg">立即注册</view>
		</view>
		<!-- 登录输入框 -->
		<view style="margin-top: 110rpx;">
			<!-- 手机号 -->
			<view style="width: 670rpx;" class="auto">
				<u--input
					v-model="phone"
					placeholder="请输入手机号"
					border="bottom"
					fontSize="32rpx"
					:customStyle="{
						borderBottom: '1px solid #ff0',
						zIndex: 99
					}"
				></u--input>
			</view>
			<!-- 密码 -->
			<view style="width: 670rpx;" class="auto mt60 dflex alc">
				<u--input
					v-model="password"
					placeholder="请输入密码"
					border="bottom"
					:type="eyesType"
					fontSize="32rpx"
					:customStyle="{
						borderBottom: '1px solid #ff0',
						zIndex: 99
					}"
				></u--input>
				<image
					@click="changeType"
					src="../static/eyes.png"
					class="posia eyes"
					v-if="eyesType == 'password'"
				></image>
				<image
					@click="changeType"
					src="../static/eyes2.png"
					class="posia eyes"
					v-if="eyesType == 'text'"
				></image>
			</view>
		</view>
		<view style="text-align: right;" class="pr50 mt20 colora" @click="handerSetpwd">忘记密码</view>
		<view class="loginbtn textc auto" @click="handerLogin">登录</view>
		<!-- 用户隐私协议 -->
		<view class="success dflex alc jcc fs28">
			<view @click="success = !success">
				<view v-if="!success"></view>
				<image v-if="success" src="../static/success.png" mode=""></image>
			</view>
			<view style="color: #999" class="ml10" @click="success = !success">同意</view>
			<view style="color: #4151DB">《用户协议》</view>
			<view style="color: #999">和</view>
			<view style="color: #4151DB">《隐私政策》</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			type: true,
			phone: '',
			password: '',
			eyesType: 'password',
			success: false
		};
	},
	methods: {
		changeType() {
			console.log(123);
			if (this.eyesType == 'password') {
				this.eyesType = 'text';
			} else if (this.eyesType == 'text') {
				this.eyesType = 'password';
			}
		},
		//跳转设置密码压面
		handerSetpwd() {
			uni.navigateTo({
				url: '/pagesC/setpwd/setpwd'
			});
		},
		//跳转到注册页面
		handerReg() {
			uni.navigateTo({
				url: '/pagesC/register/register'
			});
		},
		//登录操作
		handerLogin(){
			uni.setStorageSync('indexType',4)
			uni.reLaunch({
				url:'/pagesC/index/index'
			})
		}
	}
};
</script>

<style scoped lang="scss">
page {
	background-color: #fff;
}
.eyes {
	width: 40rpx;
	height: 40rpx;
	right: 50rpx;
	z-index: 999;
}
.psd {
	margin-left: 550rpx;
	margin-top: 20rpx;
}
.loginbtn {
	width: 670rpx;
	height: 100rpx;
	line-height: 100rpx;
	color: #fff;
	border-radius: 50rpx;
	background: linear-gradient(90deg, #8092eb 0%, #4151db 100%);
	margin-top: 140rpx;
}
.success {
	width: 750rpx;
	position: fixed;
	bottom: 92rpx;

	image {
		width: 30rpx;
		height: 30rpx;
	}
	& > view:nth-child(1) {
		& > view {
			width: 30rpx;
			height: 30rpx;
			border-radius: 50%;
			border: 2rpx solid #ccc;
		}
	}
}
</style>
